import asyncio
import websockets







async def echo(websocket, path):
    async for message in websocket:
        await websocket.send(message)





if __name__ == '__main__':


    start_server = websockets.serve(echo, "10.10.158.98", 8765)
    print("创建WebSocket服务器")
    asyncio.get_event_loop().run_until_complete(start_server)
    asyncio.get_event_loop().run_forever()
